RewriteEngine On
RewriteRule ^img_([0-9]+).(.*)(/?)+$ viewimg.php?id=$1 [L]
